<#method 1: content of read-host no assigning to a variable will make user input content at the same line #>
$a=Read-Host "Pls enter the operation you want to perform (c/D)~"

<#method 2: Conten of write-host can take one line#>
<#
Write-Host "Pls enter the operation you want to perform (c/D) c=create, D=delete :"
$a=Read-Host
#>


switch ($a) {
    'c' {
        $fileName=Read-Host "Enter the file name you want to create"
        New-Item -Path "C:\Users\Public\$fileName.txt" -ItemType File
        Write-Host "File created successfully"
    }
    'D' {
        $fileName=Read-Host "Enter the file name you want to delete"
        Remove-Item -Path "C:\Users\Public\$fileName.txt"
        Write-Host "File deleted successfully"
    }
    default {
        Write-Host "Please enter a valid operation: (c/D)"
    }
}